﻿using System;
using Dgg.LearnYourTools.NUnit.C_Assertions.Support;
using NUnit.Framework;

namespace Dgg.LearnYourTools.NUnit.C_Assertions.a_Exceptions
{
	[TestFixture]
	public class _020_ClassicAssertions
	{
		[Test]
		public void RangeCtor_UnorderedBounds_Exception_ClassicAssertion()
		{
			Assert.Throws<ArgumentOutOfRangeException>(() => new Range<int>(5, 1));
		}

		[Test]
		public void RangeCtor_UnorderedBounds_Exception_ClassicHandling()
		{
			var ex = Assert.Throws<ArgumentOutOfRangeException>(() => new Range<int>(-1, -5));

			Assert.That(ex.ParamName, Is.EqualTo("upperBound"));
			Assert.That(ex.ActualValue, Is.EqualTo(-5));
			Assert.That(ex.Message, Is.StringContaining("-5"));
		}
	}
}
